package main

import (
	"fmt"
	"sieve_engine/lib/rand"
	"time"
)

func f() {
	t := time.Now()

	time.Sleep(time.Second * 5)
	fmt.Println(int(time.Since(t).Seconds()))
}
func main() {

	f()

	return
	ch := make(chan struct{})
	counter := NewCounter(10)
	go func() {
		for i := 0; i < 10000; i++ {
			d := rand.In(0, 200)
			counter.Inc(MonitorSample{
				Delta: float64(d),
			})
			time.Sleep(time.Millisecond * 500)
		}
	}()

	go func() {
		for {
			fmt.Println("每秒一次的统计结果(30s时间范围):", counter.Calculate(30))
			fmt.Println("每秒一次的统计结果(10s时间范围):", counter.Calculate(10))

			time.Sleep(time.Second)
		}
	}()

	<-ch
}
